import { http } from '@/common/service/service.js' 
import configService from '@/common/service/config.service.js';
const apiService = {
	 baseUrl:configService.apiUrl,
	 /**
	  * 登录
	  */
	login(params) {
		return http.post('/api/sms_login',params)	
	},
	loginByAdmin(params){
		return http.post('/api/weixin_login',params)	
	},
	/**
	  * 手机号码登录
	  */
	phoneNoLogin(params) {
		return http.post('/sys/phoneLogin',params);
	},
	/**
	  * 第三方登录
	  */
	thirdLogin(token, thirdType,tenantId) {
		return http.get(`/sys/thirdLogin/getLoginUser/${token}/${thirdType}/${tenantId}`);
	},
	/**
	  * 退出
	  */
	logout(params) {
		return http.get('/api/logout',params);
	},
	/**
	 * 获取文件访问路径
	 * @param avatar
	 * @param subStr
	 * @returns {*}
	 */
	getFileAccessHttpUrl(avatar,subStr){
	    if(!subStr) subStr = 'http'
	    if(avatar && avatar.startsWith(subStr)){
	        return avatar;
	    }else{
	        return configService.staticDomainURL + "/" + avatar;
	    }
	},
	//产品列表
	productList(params) {	
		return http.get('/api/business/product/list',params)
	},
	// 用户信息
	userInfo(params) {
		return http.get('/api/user/data',params)
	},
	//用户修改
	editUser(params) {
		return http.post('/api/user/handle',params)
	},
	// 个人名片
	userCard(params) {
		return http.get('/api/user/card',params)
	},
	// 热门产品
	hotProduct(params) {
		return http.get('/api/business/product/recommend',params)
	},
	//数据统计
	statisInfo(params) {
		return http.get('/api/user/statistics/data',params)
	},
	//客户信息
	customerInfo(params) {
		return http.get('/api/user/client/select',params)
	},
	//编辑客户
	editCustomer(params) {
		return http.post('/api/user/client/handle',params)
	},
	//删除客户 
	delCustomer(params) {
		return http.post('/api/user/client/delete',params)
	},
	//B端活动单列表
	activeList(params) {
		return http.get('/api/business/activity/client',params)
	},
	//B端活动单详情
	activeB(params) {
		return http.get('/api/business/activity/data',params)
	},
	//B端问卷
	questionB(params) {
		return http.get('/api/business/question/select',params)
	},
	//C端活动单详情
	activeC(params) {
		return http.get('/api/member/business/activity/data',params)
	},
	//C端问卷
	questionC(params) {
		return http.get('/api/member/business/question/select',params)
	},
	//C端问卷提交
	confrimQuestion(params) {
		return http.post('/api/member/business/question/handle',params)
	},
	showActiveB(params) {
		return http.get('/api/business/activity/status',params)
	},
	//活动单显示
	showActiveC(params) {
		return http.get('/api/member/business/activity/status',params)
	},
	// 产品收藏
	productCollect(params) {
		return http.get('/api/member/business/collect/product/list',params)
	},
	// 案例收藏
	caseCollect(params) {
		return http.get('/api/member/business/collect/example/list',params)
	},
	// 基地收藏
	baseCollect(params) {
		return http.get('/api/member/business/collect/place/list',params)
	},
	// 讲师收藏
	lecturerCollect(params) {
		return http.get('/api/member/business/collect/teacher/list',params)
	},
	// 供应商收藏
	supplierCollect(params) {
		return http.get('/api/member/business/collect/supplier/list',params)
	},
	// 产品标记
	productLabel(params) {
		return http.get('/api/member/business/marker/product/list',params)
	},
	// 案例标记
	caseLabel(params) {
		return http.get('/api/member/business/marker/example/list',params)
	},
	// 基地标记
	baseLabel(params) {
		return http.get('/api/member/business/marker/place/list',params)
	},
	// 讲师标记
	lecturerLabel(params) {
		return http.get('/api/member/business/marker/teacher/list',params)
	},
	// 供应商标记
	supplierLabel(params) {
		return http.get('/api/member/business/marker/supplier/list',params)
	},
	//标记删除
	productDelLabel(params){
		
		return http.get('/api/member/business/marker/product/delete',params)
	},
	exampleDelLabel(params){
		
		return http.get('/api/member/business/marker/example/delete',params)
	},
	placeDelLabel(params){
		
		return http.get('/api/member/business/marker/place/delete',params)
	},
	teacherDelLabel(params){
		
		return http.get('/api/member/business/marker/teacher/delete',params)
	},
	supplierDelLabel(params){
		
		return http.get('/api/member/business/marker/supplier/delete',params)
	},
	//我的产品分享
	productShare(params) {
		return http.get('/api/member/business/share/product/list',params)
	},
	//我的 案例分享
	caseShare(params) {
		return http.get('/api/member/business/share/example/list',params)
	},
	//我的基地享
	baseShare(params) {
		return http.get('/api/member/business/share/place/list',params)
	},
	//我的讲师分享
	lecturerShare(params) {
		return http.get('/api/member/business/share/teacher/list',params)
	},
	//我的供应商分享
	supplierShare(params) {
		return http.get('/api/member/business/share/supplier/list',params)
	},
	//全部产品分享
	productAllShare(params) {
		return http.get('/api/business/share/product/list',params)
	},
	//全部案例分享
	caseAllShare(params) {
		return http.get('/api/business/share/example/list',params)
	},
	//全部基地享
	baseAllShare(params) {
		return http.get('/api/business/share/place/list',params)
	},
	//全部讲师分享
	lecturerAllShare(params) {
		return http.get('/api/business/share/teacher/list',params)
	},
	//全部供应商分享
	supplierAllShare(params) {
		return http.get('/api/business/share/supplier/list',params)
	},
	// 我的购物车
	carList(params) {
		return http.get('/api/member/business/cart/select',params)
	},
	// 加入购物车
	addCar(params) {
		return http.post('/api/member/business/cart/handle',params)
	},
	// 删除购物车
	delCar(params) {
		return http.post('/api/member/business/cart/delete',params)
	},
	// ppt模板
	pptTemplate(params) {
		return http.get('/api/business/template/select',params)
	},
	// 活动行程
	dictionary(params) {
		return http.get('/api/dictionary/data',params)
	},
	// 关于我们
	aboutUs(params) {
		return http.get('/api/wechat/company/data',params)
	},
	// 生成ppt
	createPpt(params) {
		return http.post('/api/member/business/generate/handle',params)
	},
	// 访问记录
	visitList(params) {
		return http.get('/api/business/browse/category/list',params)
	},
	// 访问详情
	visitDetail(params) {
		return http.get('/api/business/browse/list',params)
	},
	//访问时长
	visitDuration(params) {
		return http.get('/api/dictionary/data?title=browse_duration',params)
	},
	// 访问次数
	visitTimes(params) {
		return http.get('/api/dictionary/data?title=browse_total',params)
	},
	//我的访问 
	myVisitList(params) {
		return http.get('/api/member/business/browse/category/list',params)
	},
	//我的访问详情
	myVisitDetail(params) {
		return http.get('/api/member/business/browse/list',params)
	},
	// 客户详情
	customerDetail(params) {
		return http.get(`/api/business/client/view/${params}`)
	},
	// 联系人列表
	contactList(params) {
		return http.get('/api/business/contact/list',params)
	},
	myContactList(params){
		return http.get('/api/member/business/contact/list',params)
	},
	//联系人筛选
	// customerDetail(params) {
	// 	return http.get('/api/business/contact/list',params)
	// },
	// 联系人详情
	contactDetail(params) {
		return http.get(`/api/business/contact/view/${params}`)
	},
    myContactDetail(params) {
		return http.get(`/api/member/business/contact/view/${params}`)
	},
	//修改联系人
	editContact(params) {
		return http.post('/api/business/contact/handle',params)
	},
	//修改联系人权限
	editContactRoot(params) {
		return http.post('/api/business/contact/access',params)
	},
	editMyContactRoot(params) {
		return http.post('/api/member/business/contact/access',params)
	},
	//修改啊联系人状态
	editContactStatus(params) {
		return http.post('/api/business/contact/status',params)
	},
	editMyContactStatus(params){
		return http.post('/api/member/business/contact/status',params)
	},
	contactRecord(params){
		
		return http.get('/api/business/browse/category/list',params)
	}
};

export default apiService;
